package com.huahang.fashionpress.exception;

import com.huahang.fashionpress.enums.ExceptionEnum;
import lombok.Getter;
import lombok.Setter;

/**
 * 主要异常类
 * @author : 王翰聪
 * @since : 2019/08/23
 * @version : 1.0
 */

@Getter
@Setter
public class ResultException extends RuntimeException {


    private Integer code;

    public ResultException(ExceptionEnum exceptionEnum){
        super(exceptionEnum.getMsg());
        this.code = exceptionEnum.getCode();
    }

    public ResultException(Integer code, String message) {
        super(message);
        this.code = code;
    }
}
